<template>
	<div class="page linkTestDetail-page" data-page="linkTestDetail" style="z-index: 2">
	    <div class="link-page-nav">
	        <a href="#" class="link" @click=$root.backToTab()>
	            <i class="iconfont icon-zuo"></i>
	        </a>
	    </div>
	    <div class="add-keyAlarm" @click="goLinkTestTask()" id="startTestBtn_{{getNewId}}" style="display:none">
	        <a href="" class="link icon-only" data-view=".view-main">
	            <span style="font-size: 12px;width:24px;color:#fff;margin-top:7px;" id="testButton_{{getNewId}}">开始测试</span>
	        </a>
	    </div>
	    <div class="add-keyAlarm" id="workApplyBtn_{{getNewId}}">
	        <a href="" class="link icon-only" data-view=".view-main">
	            <span style="font-size: 12px;width:24px;color:#fff;margin-top:7px;">作业申请</span>
	        </a>
	    </div>
	    <div class="link-page-top">
	        <div class="link-page-title">任务详情</div>
	    </div>
	    <div class="page-content ptr-content" style="padding-bottom: 150px" @ptr:refresh="refreshCurrent">
	        <div class="ptr-preloader" style="top: -40px;">
	            <div class="preloader color-multi"></div>
	            <div class="ptr-arrow"></div>
	        </div>
            <div class="mChart" id="mChart_{{getNewId}}"></div>
            <div class="mChartInfo" id="mChartInfo_{{getNewId}}">
	            <label>完成进度</label>
	            <div><span class="pre-num" id="preNum_{{getNewId}}">0<span><span class="pre-fh">%</span></div>
	            <div class="bfb"><span style="color:#777" id="finNum_{{getNewId}}">0</span>/<span id="total_{{getNewId}}">0</span></div>
	        </div>
	        <div class="content-panels" style="margin-top:0">
	            <div class="sta_time">
	                <span id="status_{{getNewId}}"></span>
	                <span class="marginl" id="residueTime_{{getNewId}}"></span>
	            </div>
	            <p class="tt" style="margin-bottom:0;font-weight: bold" id="taskName_{{getNewId}}"></p>
	            <div class="unit-name"><i class="iconfont icon-APPicon_dingwei" style="color:#2471CA"></i><label id="unitName_{{getNewId}}"></label></div>
	            <div>
	                <span class="iteml">时间周期</span>
	                <span class="itemr" id="planTime_{{getNewId}}"></span>
	            </div>
	        </div>
	        <div class="bottom-line"></div>

	        <div class="content-panels" id="finshTask_{{getNewId}}">
	            <p class="tt">已完成作业</p>
	            <div class="pdb10">
	                <a href="#" @click="picDetail(1)" style="display:block">
	                    <span class="iteml">已上传作业前照片</span>
						<span class="itemr"><i class="icon iconfont icon-jiantou beforePicLen"></i> <span class="beforePicNull" style="display: none;color:#397ECE;">0</span></span>
	                </a>
	            </div>
	            <ul class="pic-panels" id="beforPic_{{getNewId}}">
	            </ul>
	            <div class="pdb10">
	                <a href="#" @click="picDetail(2)" style="display:block">
	                    <span class="iteml">已上传作业后照片</span>
	                    <span class="itemr"><i class="icon iconfont icon-jiantou afterPicLen"></i><span class="afterPicNull" style="display: none;color:#397ECE;">0</span></span>
	                </a>
	            </div>
	            <ul class="pic-panels" id="afterPic_{{getNewId}}">
	            </ul>
	        </div>
	        <div class="content-panels RelationPolice1 RelationPolice2" id="relativePolice_{{getNewId}}" style="margin-top: 35px;display: none;">
	            <span class="tt">关联警情</span>
	            <p class="hint">系统自动关联可能由当前联动测试引起的设备报警信息。如果和实际不一致，请修改。</p>
	            <ul id="alarmList_{{getNewId}}">
	            </ul>
	            <div class="deviceHint">
	                <span id="deviceHintInfo_{{getNewId}}"></span>
	            </div>
	            <div>共发生警情<span style="margin-left:8px" id="alarmTotal_{{getNewId}}"></span><a href="#" @click="correlatedAlarm()"><label>明细</label></a></div>
	            <div class="hr"></div>
	        </div>

	        <div class="content-panels" style="margin-top: 50px" id="workValueView_{{getNewId}}">
	            <span class="tt">作业填报</span>
	            <div id="workContentListView_{{getNewId}}">
	            </div>
	        </div>
	        <div class="content-panels" style="margin-top:60px">
	            <div>
	                <span class="tt">任务责任人</span>
	                <a href="#" id="addMan_{{getNewId}}" @click="addMan()">
	                    <span class="itemr" style="color: #397ECE"><i class="iconfont icon-APPicon_tianjia" style="color: #397ECE;margin-right:4px"></i>添加责任人</span>
	                </a>
	            </div>
	            <div id="linkTestListItem_{{getNewId}}" style="display: inline-block; width: 100%;"></div>
	        </div>

	        <div class="content-panels">
	            <p class="tt" style="margin-bottom:20px">作业内容</p>
	            <p class="work-content" id="workContent_{{getNewId}}"></p>
	        </div>
	        <div class="bottom-line"></div>

	        <div class="content-panels">
	            <p class="tt" style="margin-bottom:20px">作业标准</p>
	            <p class="work-content" id="workStandard_{{getNewId}}"></p>
	        </div>
	        <div class="bottom-line"></div>

	        <div id="timeLine_{{getNewId}}">
	            <div class="content-panels">
	                <p class="tt" style="margin-bottom:15px">任务完成时间线</p>
	                <a href="#" @click="timeLine()" style="display:block">
	                    <span class="iteml">立即查看</span>
	                    <span class="itemr"><i class="icon iconfont icon-jiantou"></i></span>
	                </a>
	            </div>
	            <div class="bottom-line"></div>
	        </div>

	        <div id="repairList_{{getNewId}}">
	            <div class="content-panels">
	                <p class="tt" style="margin-bottom:15px">关联的故障维修单</p>
	                <a href="#" style="display:block" @click="goRepairList()">
	                    <span class="iteml">立即查看</span>
	                    <span class="itemr"><i class="icon iconfont icon-jiantou"></i></span>
	                </a>
	            </div>
	            <div class="bottom-line"></div>
	        </div>

	        <div class="content-panels">
	            <p class="tt" style="margin-bottom:15px">关联的作业申请单</p>
	            <a href="#" style="display:block" @click="workApply">
	                <span class="iteml">立即查看</span>
	                <span class="itemr"><i class="icon iconfont icon-jiantou"></i></span>
	            </a>
	        </div>
	    </div>
	</div>
</template>
<style scoped>
.demo-swiper{
    margin: 0px;
    height: 75px;
}
.demo-swiper .swiper-slide img {
    height: 75px;
    display: block;
}
</style>
<script>
	return {
		mounted() {
            var self = this;
            var app = self.$app;
            self.taskId=this.$route.params.taskId;
        },
        data : function() {
			return {
				getNewId: (new Date()).getTime(),
        		pageName:"linkTestDetail",
				orgIds:0,
				orgName:"",
				taskName:"",
				status:0,
        		taskId:'',
        		saveResponsPeople:[],  // 保存责任人
        		taskHandelStatus:0,
        		doTastPeople:'',
        		doTastTestTaskId:'',
        		relateTaskList:{},
        		workAcoountsStatus:0,//状态：0：表示未开始，1：表示开始，是当前用户已加入2：表示已开始，当前用户未加入
			}
        },
        methods : {
        	picDetail:function(type){//跳转照片墙
				var self=this;
				if(native.getDataByKey("IS_OFFLINE_MODULE") == 1){
					app.methods.showToastCenter("离线模式下不能跳转");
					return
				}else{
					app.router.navigate("/maintainDetailPic/"+self.taskId+"/"+type + "/")
				}
        	},
        	timeLine:function(){//跳转时间线
				var self = this;
				if(native.getDataByKey("IS_OFFLINE_MODULE") == 1){
					app.methods.showToastCenter("离线模式下不能跳转");
					return
				}else{
					app.router.navigate("/maintainDetailTimeLine/"+self.taskId+"/4");
				}
	        },
	        addMan:function(){//跳转添加责任人
        		var self = this;
        		if(self.saveResponsPeople.length == 0){
        			self.saveResponsPeople.push(0);
        		}
        		app.router.navigate("/maintainOwner/"+self.orgIds+"/"+self.taskId+"/linkTestDetail/"+self.saveResponsPeople.toString());
	        },
	        workApply:function(){//跳转作业申请
				var self = this;
				if(native.getDataByKey("IS_OFFLINE_MODULE") == 1){
					app.methods.showToastCenter("离线模式下不能跳转");
					return
				}else{
					app.router.navigate("/workApplyList/"+self.taskId+"/");
				}
	        },
	        correlatedAlarm:function(){//跳转到关联的警情  type 0  查看  1编辑
        		var self = this;
        		app.router.navigate("/correlatedAlarm/"+self.taskId+"/0/0/0/0/linkTestDetail");
	        },
	        goLinkTestTask:function(){//跳转到联动测试作业页面
        		var self = this;
        		if(self.taskStatus == 1){
        		    //作业申请
        		    var self = this;
	            	var jsonTask = JSON.stringify(self.relateTaskList);
        			app.router.navigate("/workApplyCreate/"+self.taskId+"/"+jsonTask+"/");
        		}else{
	        		//继续测试
	        		if(self.taskHandelStatus == 1){
	        			app.router.navigate("/linkTestTask/"+self.taskId+"/"); 
	        		}
	        		//加入测试
	        		else if(self.taskHandelStatus == 2){
	        		    joinTest(self.doTastPeople,self.doTastTestTaskId,function(){
	        		    	app.router.navigate("/linkTestTask/"+self.taskId+"/"); 
	        		    });
	        		}else{
	        		    startTest(self.taskId,function(){
	        		    	//跳转联动测试作业页面
	                  		app.router.navigate("/linkTestTask/"+self.taskId+"/"); 
	        		    });
	        		}
        		}
	        },
	        goRepairList:function(type){//跳转关联故障单
				var self=this;
				if(native.getDataByKey("IS_OFFLINE_MODULE") == 1){
					app.methods.showToastCenter("离线模式下不能跳转");
					return
				}else{
					app.router.navigate("/repairList/"+self.taskId+"/");
				}
        	},
	        //获取关联的警情统计
	        getRelateAlarmCountByTaskId:function(){
	        	var self = this;
				$("#deviceHintInfo_" + self.getNewId).parent().hide();
	        	$("#alarmList_" + self.getNewId).hide();
	        	Dao.getRelateAlarmCountByTaskId({
	        		userName:userInfor.accountName,
                    deviceId:appKeyObj.deviceId,
                    taskId:self.taskId,
	        	},function(data,total){
	        		common.loading(0);
	        		var alarmTotal=0;
	        		if(total>0){
		        		if (data!=null&&data.length != 0) {
		        			jQuery("#alarmList_" + self.getNewId).empty().show();
		        			for(var i=0;i<data.length;i++){
		        				var icons=JSON.parse(data[i].iconUrl).icon;
		        				 if(data[i].fireTTypes=="10"){
			        				$("#alarmList_" + self.getNewId).append(`<li>
			        						<div class="img"><img src="`+icons+`"></div>
			        						<span>`+data[i].fcFacilitiesCategoryName+`</span>
			        						<span class="times"><label style="color:#E07762">报警 </label>×<label>`+data[i].times+`</label>次</span>
			        					</li>`);
		        			 	}else{
		        					$("#alarmList_" + self.getNewId).append(`<li>
		        							<div class="img"><img src="`+icons+`"></div>
			        						<span>`+data[i].fcFacilitiesCategoryName+`</span>
			        						<span class="times"><label style="color:#FFC73B">故障 </label>×<label>`+data[i].times+`</label>次</span>
			        					</li>`);
		        				} 
		        				 alarmTotal=alarmTotal+data[i].times;
		        			}
		        			 		
		        		}
	        		}else{
						$("#deviceHintInfo_" + self.getNewId).parent().show();
	        			$("#deviceHintInfo_" + self.getNewId).empty().html(common.transNullundefinedToline(data.info)); 
	        		}
	        		$("#alarmTotal_" + self.getNewId).empty().html(alarmTotal+"次");
	        	});
	        },
	        getWorkValue:function(){//获取作业信息
				var self = this;
				Dao.getMaintainTaskDetailInfoDtoForLD({
					userName:userInfor.accountName,
                    deviceId:appKeyObj.deviceId,
                    taskId:self.taskId,//任务id
				},function (data){
					if (data!=null&&data.length != 0) {
						$("#workContentListView_" + self.getNewId).empty();
						var descriptionStr=JSON.parse(data.description);
						self.workContentList=data.maintainStandardContentList;
						for (var i=0;i<self.workContentList.length;i++) {
							var bean=self.workContentList[i];
							var inputHtml="";
							var checkHtml=`
								<p class="buttons-row" style="margin-top: 15px;">
									<div class="checkItem">
									 	<input type="radio" name="normal_` + (self.getNewId + '_' + i) + `" value="0" disabled="disabled">
									 	<label name="normal_` + (self.getNewId + '_' + i) + `" for="normal_` + (self.getNewId + '_' + i) + `">正常</label>
								 	</div>
								 	<div class="checkItem" style="margin: 0 3%;">
									 	<input type="radio" name="abnormal_` + (self.getNewId + '_' + i) + `" value="1" disabled="disabled">
									 	<label name="abnormal_` + (self.getNewId + '_' + i) + `" for="abnormal_` + (self.getNewId + '_' + i) + `">异常</label>
								 	</div>
								 	<div class="checkItem">
									 	<input type="radio" name="notInvoled_` + (self.getNewId + '_' + i) + `" value="2" disabled="disabled">
									 	<label name="notInvoled_` + (self.getNewId + '_' + i) + `" for="notInvoled_` + (self.getNewId + '_' + i) + `">未涉及</label>
								 	</div>
								</p>`;
							var decHtml = `
								<p style="margin-top: 15px;">
									<input type="text" class="inDes" value="`+ descriptionStr[bean.id].des + `" disabled="disabled"/>
								</p>`;
							var numHtml = `
								<p style="margin-top: 15px;">
								<input type="number" class="inNum" value="`+ descriptionStr[bean.id].num + `" disabled="disabled"/>
							</p>`
							switch(bean.type){//1：单选，2：文本，3：数值，4：单选+文本，5：单选+数值，6：数值+文本
								case 1:inputHtml=checkHtml;
									break;
								case 2:inputHtml=decHtml;
									break;
								case 3:inputHtml=numHtml;
									break;
								case 4:inputHtml=checkHtml+decHtml;
									break;
								case 5:inputHtml=checkHtml+numHtml;
									break;
								case 6:inputHtml=numHtml+decHtml;
									break; 
							} 
							$("#workContentListView_" + self.getNewId).append(`
								<div style="margin-bottom: 15px;">
									<p class="workContent">`+ bean.workContent + `</p>
									`+ inputHtml + `
								</div>
							`);
							var tabid = descriptionStr[bean.id].tab;
							if (tabid == 0) {
								$("input[name=normal_" + (self.getNewId + '_' + i) + "]").attr("checked", "checked");
								$("label[name=normal_" + (self.getNewId + '_' + i) + "]").addClass("checked");
							} else if (tabid == 1) {
								$("input[name=abnormal_" + (self.getNewId + '_' + i) + "]").attr("checked", "checked");
								$("label[name=abnormal_" + (self.getNewId + '_' + i) + "]").addClass("checked");
							} else {
								$("input[name=notInvoled_" + (self.getNewId + '_' + i) + "]").attr("checked", "checked");
								$("label[name=notInvoled_" + (self.getNewId + '_' + i) + "]").addClass("checked");
							}
						}
					}
				}); 
			},
			getTestTaskStatus:function(){//获取当前用户任务状态
		      	  var self = this;
		      	  common.loading(1);
		      	  Dao.getTestTaskStatus({
		                userName: userInfor.accountName,
		                account: userInfor.accountName,
		                taskId: self.taskId, //任务id
		                type:4,//type维保类型 1 维保巡查任务 2保养任务 3测试任务 4联动测试任务
		            }, function(data) {
		          	  self.workAcoountsStatus=data.status;
		          	  self.getInfoData();
		            });
		        },
        	  getInfoData:function(){//获取任务信息
     			var self = this;
     			$("#finshTask_" + self.getNewId).hide();
				$("#timeLine_" + self.getNewId).hide();
				$("#repairList_" + self.getNewId).hide();
				$("#addMan_" + self.getNewId).hide();
				$("#workValueView_" + self.getNewId).hide();
     			
     			Dao.getMaintainTaskInfoDto({
     				userName:userInfor.accountName,
                     deviceId:appKeyObj.deviceId,
                     taskId:self.taskId,//任务id
                     //taskId:1,//任务id
				 },function (data){
					common.loading(0);
     				if (data) {
     					self.buildRelateTask(data);
     					self.orgIds=data.orgId;
     					self.orgName=data.orgName;
     					self.taskName=data.name;
						 self.status=data.status;  //任务状态 1：未开始 2：进行中 3：已结束
						 
						self.taskStatus = self.status;
						if(self.taskStatus==1){
							if(userInfor.role[0].id==183 || userInfor.role[0].id==184)
							$("#addMan_" + self.getNewId).show();
						}else if(self.taskStatus==2){
							$("#finshTask_" + self.getNewId).show();
							$("#timeLine_" + self.getNewId).show();
							$("#repairList_" + self.getNewId).show();
							if(userInfor.role[0].id==183 || userInfor.role[0].id==184)
							$("#addMan_" + self.getNewId).show();
						}else{
							$("#finshTask_" + self.getNewId).show();
							$("#timeLine_" + self.getNewId).show();
							$("#repairList_" + self.getNewId).show();
							$("#workValueView_" + self.getNewId).show();
							self.getWorkValue();
						}
     					//联动测试特殊处理
     					var finCount=0;
     					if(data.finishCount){
     						finCount=data.finishCount;
						}
						var percent = 0;
						if(finCount != 0){
							percent = 100;
						}
						if (percent == 0 || percent == 100) {
							percent = percent;
						} else {
							percent = percent.toFixed(2);
						}
						$("#preNum_" + self.getNewId).html(common.transNullundefinedToline(percent+"%")); 
     					$("#finNum_" + self.getNewId).html(common.transNullundefinedToline(finCount+"")); 
     					$("#total_" + self.getNewId).html(finCount); 
						self.initChart(percent);

     					var staStr;
     					if(data.status==1){
     						staStr="未开始";
     					}else if(data.status==2){
     						staStr="进行中";
     					}else{
                       	    if(finCount != 0) {
                       	    	staStr = "已结束&nbsp;&nbsp;<span>已完成</span>";
                       	    } else {
                       		    staStr = "已结束&nbsp;&nbsp;<span style='color:#E07762'>未完成</span>";  
                       	    }
     					}
     					$("#status_" + self.getNewId).empty().html(common.transNullundefinedToline(staStr));
     					if(data.status!=3){
	     					$("#residueTime_" + self.getNewId).empty().html(toEndTime(data.endTime));//剩余365天23小时
     					}else{
     						$("#residueTime_" + self.getNewId).hide();
     					}
     					$("#taskName_" + self.getNewId).empty().html(common.transNullundefinedToline(self.taskName));
     					$("#unitName_" + self.getNewId).empty().html(common.transNullundefinedToline(self.orgName));
     					$("#planTime_" + self.getNewId).empty().html(common.transNullundefinedToline(moment(data.startTime.substring(0,10)).format('YYYY/MM/DD')+" ~ "+moment(data.endTime.substring(0,10)).format('YYYY/MM/DD')));
							let beforePicList = data.beforeWorkPicList;
			                let afterPicList = data.afterWorkPicList;
							if(JSON.stringify(beforePicList)==='{}'){
                            $("#beforPic_" + self.getNewId).hide()
                            jQuery('.beforePicNull').show()
                            jQuery('.beforePicLen').hide()
                        }else{
                            $("#beforPic_" + self.getNewId).show()
                            jQuery('.beforePicLen').show()
                        }
                        if(JSON.stringify(afterPicList)==='{}'){
                            jQuery('.afterPicNull').show()
                            jQuery('.afterPicLen').hide()
                            $("#afterPic_" + self.getNewId).hide()
                        }else{
                            jQuery('.afterPicLen').show()
                            $("#afterPic_" + self.getNewId).show()
                        }
						  	$("#beforPic_" + self.getNewId).empty();
							let picArr = [];
							for (let key in beforePicList) {
								let picUrls = beforePicList[key];
								let picAarr = picUrls.split(',');
								picArr = picArr.concat(picAarr);
							}
							//展示图片
							showImage(jQuery("#beforPic_" + self.getNewId), picArr.toString(), 3);
							
							$("#afterPic_" + self.getNewId).empty();
							let picArr1 = [];
							for (let key in afterPicList) {
								let picUrls = afterPicList[key];
								let picAarr = picUrls.split(',');
								picArr1 = picArr1.concat(picAarr);
							}
							//展示图片
							showImage(jQuery("#afterPic_" + self.getNewId), picArr1.toString(), 3);
					
						var userList=data.dutyUserList;
						var userHtml="";
						var maintainAccount="";//用于判断当前登录人是否责任人
						self.saveResponsPeople = [];
						$("#linkTestListItem_" + self.getNewId).empty();
						if(userList){
							for(var i=0;i<userList.length;i++){
								self.saveResponsPeople.push(userList[i].accountName);
								maintainAccount+=userList[i].accountName;
								var phoneNum=userList[i].phone;
								if (i % 2 == 0) {
									userHtml += `<div class="area-panels">
				        				<a href="tel:`+ phoneNum + `" onclick="window.location='tel:` + phoneNum + `'">
				        				<p>`+ userList[i].name + ` <i class="iconfont icon-phone-channel phone"></i></p>
				        				<p class="area" style="color:#999">`+ (userList[i].postName ? userList[i].postName : "-") + `</p>
			        				</a>
			        			</div>`
								} else {
									userHtml += `<div class="area-panels" style="margin-right:0">
										<a href="tel:`+ phoneNum + `" onclick="window.location='tel:` + phoneNum + `'">
				        				<p>`+ userList[i].name + ` <i class="iconfont icon-phone-channel phone"></i></p>
				        				<p class="area" style="color:#999">`+ (userList[i].postName ? userList[i].postName : "-") + `</p>
			        				</a>
			        			</div>`
								}
							}
							$("#linkTestListItem_" + self.getNewId).append(userHtml);
						}else{
							//$("#linkTestListItem_" + self.getNewId).hide();
						}
						if(self.taskStatus<3 && maintainAccount.indexOf(userInfor.accountName)>=0){//当前登录人是责任人
							$("#addMan_" + self.getNewId).show();
							if(self.workAcoountsStatus==1)
								jQuery("#startTestBtn_" + self.getNewId).show();
						}else{
							jQuery("#startTestBtn_" + self.getNewId).hide();
						}
						var contentList=data.maintainStandardContentList;
						var workContentStr="";
						for(var i=0;i<contentList.length;i++){
							if((i+1)!=contentList.length){
								workContentStr+=contentList[i].workContent+"；"
							}else{
								workContentStr+=contentList[i].workContent+"。"
							}
						}
						$("#workContent_" + self.getNewId).empty().html(common.transNullundefinedToline(workContentStr));
						$("#workStandard_" + self.getNewId).empty().html(common.transNullundefinedToline(data.workStandard));
						self.getRelateAlarmCountByTaskId();
						
						//开始测试按钮状态
						//未开始详情
						if(self.taskStatus == 1){
						    $("#testButton_" + self.getNewId).html("作业申请");
						}else{
						    self.taskHandelStatus = data.taskStatus;
						    if(self.taskHandelStatus){
						        if(self.taskHandelStatus == 1){
						            $("#testButton_" + self.getNewId).html("继续测试");
						        }else if(self.taskHandelStatus == 2){
						            $("#testButton_" + self.getNewId).html("加入测试");
						        }else{
						            $("#testButton_" + self.getNewId).html("开始测试");
						        }
						    }
						}
						//正在测试人员
						self.doTastPeople = data.testTaskWorkAcoounts;
						self.doTastTestTaskId = data.testTaskId;
     				}
     			});
     		},
            initChart:function(value){
				let self =this
				var myChart = echarts.init(document.getElementById("mChart_" + self.getNewId));
            	option = {
            		color:['#2471CA','#F1F1F1'],
           			series: [
           		        {
           		            name:'',
           		            type:'pie',
           		         	radius: ['50%', '60%'],
                       		center: ['50%', '45%'],
           		            avoidLabelOverlap: false,
           		            label: {
           		                normal: {
           		                    show: false,
           		                    position: 'center'
           		                },
           		                emphasis: {
           		                    show: true,
           		                    textStyle: {
           		                        fontSize: '30',
           		                        fontWeight: 'bold'
           		                    }
           		                }
           		            },
           		            labelLine: {
           		                normal: {
           		                    show: false
           		                }
           		            },
           		            data:[
           		                {value:value, name:''},
           		                {value:100-value, name:''},
           		            ]
           		        }
           		    ]
            		};
            	 myChart.setOption(option, true);
            },
            refreshCurrent: function(e, done) {
                var self = this;
                var $ = self.$$;
                if (done && e) {
                    setTimeout(function() {
                        self.getInfoData();
                        done();
                    }, 1000);
                }
            },
            buildRelateTask:function(data){
            	var self = this;
            	var obj = {};
                obj.id= data.id;
                obj.name= data.name;
                obj.status = data.status;
                obj.maintainType = data.maintainType;
                obj.startTime= data.startTime;
                obj.endTime= data.endTime;
                self.relateTaskList[data.id]=obj;
            },
        },
        on: {
			pageInit: function (e, page) {
				var self = this;
				self.getTestTaskStatus();
				jQuery("#workApplyBtn_" + self.getNewId).hide();
			},
			pageAfterIn: function (e, page) {
				var self = this;
				//未开始里面不展示警情
				if (self.taskStatus != 1) {
					$("#relativePolice_" + self.getNewId).show();
				}
			}
		}
    }
</script>